-
Notifications
You must be signed in to change notification settings - Fork 292
CP-540722: Define the MIRROR
interface to be implemented by Storage_smapi{v1,v3}_migrate.ml
#6404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP-540722: Define the MIRROR
interface to be implemented by Storage_smapi{v1,v3}_migrate.ml
#6404
Conversation
3ed0aba
to
743f149
Compare
743f149
to
3267ec3
Compare
`import_activate` and `get_nbd_server` is more like datapath functions so I am moving them into the `DATA` module whereas they were previoulsy in `DATA.MIRROR` module. Reserve `DATA.MIRROR` only for storage migrate functionalities that is implemented in the xapi layer but no in the storage layer. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
There are several functions in storage_interface and hence storage_mux, such as `start`, `stop`, `list`. These functions are currently not multiplexed but just called directly into storage_migrate. In fact, they are unlikely to be multiplexed because they use the `State` module in storage migrate, which is a in memory hashtable in xapi, not accessible by xapi-storage-script. So remove them from the storage interface, and callers of these functions can call them from storage_migrate directly rather than going through the storage interface. None of these are remote functions so no need to worry about backwards compatibility. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
The `send_start` function is a subroutine inside the `Storage_migrate.start` function, which takes the mirror prepared by the `receive_start` and initiates mirroring to the remote VDI. This commit only defines the interface, which means this function is currently unused. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
Just so that they type check, some of the functions are still unimplemented, and these functions are still unused. Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
Would suggest to replace:
|
3267ec3
to
36d41aa
Compare
Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
MIRROR
interface to be implemented by Storage_smapi{v1,v3}_migrate.mlMIRROR
interface to be implemented by Storage_smapi{v1,v3}_migrate.ml
let nearest = | ||
List.fold_left | ||
(fun acc content_id -> | ||
match acc with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a fold? I understand it returns the first acc
it finds - so It is more like a find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, problem of using List.find
is that it will return an element in similar
while what we want is an element in vdis
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talked it with Vincent, the List.finds can't be switched, because ordering is important
Signed-off-by: Vincent Liu <shuntian.liu2@cloud.com>
This is a continuation of #6404, which completes the refactoring of SXM code for the new architecture. I expect there to be no functional change, although there is a significant change of how error handling is done. The last couple of commits contain the design for this PR. To be continued...
This is a continuation of #6378: the refactoring effort of SXM code.
To be continued...